import unittest
from water3 import *
class MyTestCase(unittest.TestCase):
    def setUp(self):
        print("测试开始")
    def test_something(self):
        name_list = ['宋江','李逵','武松','林冲','鲁智深','吴用','卢俊义','柴进','花荣','史进','杨志','顾大嫂','孙二娘','王进','扈三娘','陆谦']
        txt_path = 'water.txt'
        name_list_count = [2765, 1247, 1151, 759, 647, 639, 632, 328, 260, 242, 239, 105, 74, 68, 52, 47]
        items = list()
        for i in range(16):
            items.append([name_list[i], name_list_count[i]])
        self.assertEqual(items, NameCount().getNameTimesSort(name_list,txt_path))
    def tearDown(self):
        print("测试结束")
if __name__ == '__main__':
    unittest.main()
